import request from '@/utils/request'
import { getMiniAppId } from '@/utils/index'
// 列表
export function contentIndex(data) {
  return request({
    url: '/admin/sys_playlet/list',
    method: 'post',
    data: data
  })
}
// 新增合同剧和版本剧
export function addPlaylet(data) {
  return request({
    url: '/admin/sys_playlet/addPlaylet',
    method: 'post',
    data: data
  })
}
export function addVersionPlaylet(data) {
  return request({
    url: '/admin/sys_playlet/addVersionPlaylet',
    method: 'post',
    data: data
  })
}
// 上传
export function uploadChapter(data) {
  return request({
    url: '/admin/sys_playlet/uploadChapter',
    method: 'post',
    data: data
  })
}
// 详情
export function detail(data) {
  return request({
    url: '/admin/sys_playlet/detail',
    method: 'post',
    data: data
  })
}
// 删除
export function delPlaylet(data) {
  return request({
    url: '/admin/sys_playlet/delPlaylet',
    method: 'post',
    data: getMiniAppId(data)
  })
}
export function delChapter(data) {
  return request({
    url: '/admin/sys_playlet/delChapter',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 原有的播放链接
export function idPlayUrl(data) {
  return request({
    url: '/admin/sys_playlet/play',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 新增的播放链接
export function getSignUrl(data) {
  return request({
    url: '/admin/sys_playlet/getSignUrl',
    method: 'post',
    data: getMiniAppId(data)
  })
}

/** 内容同步 */

// 同步到小程序
export function syncPlaylet(data) {
  return request({
    url: '/admin/sys_playlet/syncPlaylet',
    method: 'post',
    data: data
  })
}
// 剧关联的小程序
export function miniAppListContent(data) {
  return request({
    url: '/admin/sys_playlet/miniAppList',
    method: 'post',
    data: data
  })
}
// 一键下架
export function offlinePlayLet(data) {
  return request({
    url: '/admin/sys_playlet/offlinePlayLet',
    method: 'post',
    data: data
  })
}
// 内容同步记录
export function taskList(data) {
  return request({
    url: '/admin/task/list',
    method: 'post',
    data: data
  })
}
// 小程序间同步内容
export function syncPlayletMiniApp(data) {
  return request({
    url: '/admin/mini_app/syncPlaylet',
    method: 'post',
    data: data
  })
}

// 下载视频

export function downloadPlaylet(data) {
  return request({
    url: '/admin/sys_playlet/download',
    method: 'post',
    data: data
  })
}

// 过审的小程序列表
export function checkedMiniApp(data) {
  return request({
    url: '/admin/sys_playlet/checkedMiniApp',
    method: 'post',
    data: data
  })
}
// 设置过审播放链接
export function setPlayLink(data) {
  return request({
    url: '/admin/sys_playlet/setPlayLink',
    method: 'post',
    data: data
  })
}

// 合作方列表
export function partnerList(data) {
  return request({
    url: '/admin/partner/index',
    method: 'post',
    data: data
  })
}
// 合同剧下拉
export function contractList(data) {
  return request({
    url: '/admin/playlet_check/contractPlayList',
    method: 'post',
    data: data
  })
}

// 短剧详情
export function playletDetails(data) {
  return request({
    url: '/admin/sys_playlet/detail',
    method: 'post',
    data: data
  })
}
// 下一部短剧
export function setNextPlaylet(data) {
  return request({
    url: '/admin/sys_playlet/setNextPlaylet',
    method: 'post',
    data: data
  })
}
// 保存标签
export function tagSave(data) {
  return request({
    url: '/admin/sys_playlet/tagSave',
    method: 'post',
    data: data
  })
}
// 标签列表
export function tagList(data) {
  return request({
    url: '/admin/sys_playlet/tagList',
    method: 'post',
    data: data
  })
}

// 短剧推荐开关
export function sysPlayletRecommendSwitch(data) {
  return request({
    url: '/admin/sys_playlet/recommendSwitch',
    method: 'post',
    data: data
  })
}

export function sysPlayletSetRecommendConfig(data) {
  return request({
    url: '/admin/sys_playlet/setRecommendConfig',
    method: 'post',
    data: data
  })
}

// 详情下啊数据
export function analysisDropdown(data) {
  return request({
    url: '/admin/mini_app_playlet/analysisDropdown',
    method: 'post',
    data: getMiniAppId(data)
  })
}
// 剧集分析
export function chapterAnalysis(data) {
  return request({
    url: '/admin/mini_app_playlet/chapterAnalysis',
    method: 'post',
    data: data
  })
}

// 腾讯三级下拉
export function getPlayletCategory(data) {
  return request({
    url: '/admin/sys_playlet/getPlayletCategory',
    method: 'post',
    data: data
  })
}

// 短剧配置分销方
export function addDistributor(data) {
  return request({
    url: '/admin/sys_playlet/addDistributor',
    method: 'post',
    data: data
  })
}

// 批量配置分销方
export function batchDistributor(data) {
  return request({
    url: '/admin/sys_playlet/batchDistributor',
    method: 'post',
    data: data
  })
}
